﻿using System.Threading.Tasks;

namespace NetMicro.Cache.DelayBus
{
    /// <summary>
    /// 延迟任务服务
    /// </summary>
    public interface IDelayTaskService
    {
        /// <summary>
        /// 添加一个延迟任务
        /// </summary>
        /// <param name="eventJob"></param>
        /// <returns></returns>
        Task PublishAsync(EventJob eventJob);

        /// <summary>
        /// 添加一个延迟任务
        /// </summary>
        /// <param name="eventJob"></param>
        /// <returns></returns>
        void Publish(EventJob eventJob);
        /// <summary>
        ///  删除一个延迟任务
        /// </summary>
        /// <param name="topic"></param>
        /// <param name="jobId"></param>
        /// <returns></returns>
        Task RemoveDealyJobAsync(string topic, string jobId);

        /// <summary>
        ///  删除一个延迟任务
        /// </summary>
        /// <param name="topic"></param>
        /// <param name="jobId"></param>
        /// <returns></returns>
        void RemoveDealyJob(string topic, string jobId);


    }
}
